package com.alex.springbootdemo.model.dto;

import com.alex.springbootdemo.model.pojo.PmsBrand;

import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;

public class TestConvertor {
    public static void main(String[] args) {
        PmsBrand pmsBrand = new PmsBrand();
        pmsBrand.setName("名称");
        pmsBrand.setLogo("logo");
        pmsBrand.setSort(2);


        PmsBrandDTO pmsBrandDTO = PmsBrandConvertor.convert(pmsBrand);


        List<PmsBrand> entityList = Collections.singletonList(pmsBrand);
        List<PmsBrandDTO> dtoList = entityList.stream().map(PmsBrandConvertor::convert).collect(Collectors.toList());

        System.out.println("pmsBrand:" + pmsBrand);
        System.out.println("pmsBrandDto:" + pmsBrandDTO);
        System.out.println("entityList:" + entityList);
        System.out.println("dtoList:" + dtoList);

    }
}
